<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>用户管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/front/frontUser/">用户列表</a></li>
		<shiro:hasPermission name="front:frontUser:edit"><li><a href="${ctx}/front/frontUser/form">用户添加</a></li></shiro:hasPermission>
	</ul>
	<form:form id="searchForm" modelAttribute="frontUser" action="${ctx}/front/frontUser/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<ul class="ul-form">
			<li><label>姓名：</label>
				<form:input path="name" htmlEscape="false" maxlength="100" class="input-medium"/>
			</li>
			<li><label>性别：</label>
				<form:radiobuttons path="sex" items="${fns:getDictList('sex')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
			</li>
			<li><label>电话号码：</label>
				<form:input path="phoneNum" htmlEscape="false" maxlength="13" class="input-medium"/>
			</li>
			<li><label>省份：</label>
				<form:select path="provinceId" class="input-medium">
					<form:option value="" label=""/>
					<form:options items="${fns:getRegionList('2')}" itemLabel="name" itemValue="id" htmlEscape="false"/>
				</form:select>
			</li>
			<li><label>毕业学校：</label>
				<form:input path="school" htmlEscape="false" maxlength="100" class="input-medium"/>
			</li>
			<li><label>文理科：</label>
				<form:select path="artsScience" class="input-medium">
					<form:option value="" label=""/>
					<form:options items="${fns:getDictList('')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			</li>
			<li><label>成绩：</label>
				<form:input path="grade" htmlEscape="false" class="input-medium"/>
			</li>
			<li><label>账号：</label>
				<form:input path="account" htmlEscape="false" maxlength="100" class="input-medium"/>
			</li>
			<li><label>毕业年份：</label>
				<form:input path="graduateYear" htmlEscape="false" maxlength="6" class="input-medium"/>
			</li>
			<li><label>删除标志：</label>
				<form:select path="delFlag" class="input-medium">
					<form:option value="" label=""/>
					<form:options items="${fns:getDictList('del_flag')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			</li>
			<li><label>启用标志：</label>
				<form:select path="loginFlag" class="input-medium">
					<form:option value="" label=""/>
					<form:options items="${fns:getDictList('yes_no')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			</li>
			<li><label>会员标志：</label>
				<form:select path="vipFlag" class="input-medium">
					<form:option value="" label=""/>
					<form:options items="${fns:getDictList('yes_no')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			</li>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>姓名</th>
				<th>性别</th>
				<th>电话号码</th>
				<th>地址</th>
				<th>邮箱</th>
				<th>省份</th>
				<th>毕业学校</th>
				<th>文理科</th>
				<th>成绩</th>
				<th>账号</th>
				<th>毕业年份</th>
				<th>启用标志</th>
				<th>会员标志</th>
				<th>登陆IP</th>
				<th>最近上线时间</th>
				<shiro:hasPermission name="front:frontUser:edit"><th>操作</th></shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="frontUser">
			<tr>
				<td><a href="${ctx}/front/frontUser/form?id=${frontUser.id}">
					${frontUser.name}
				</a></td>
				<td>
					${fns:getDictLabel(frontUser.sex, 'sex', '')}
				</td>
				<td>
					${frontUser.phoneNum}
				</td>
				<td>
					${frontUser.address}
				</td>
				<td>
					${frontUser.mail}
				</td>
				<td>
					${fns:getRegionById(frontUser.provinceId).name}
				</td>
				<td>
					${frontUser.school}
				</td>
				<td>
					${fns:getDictLabel(frontUser.artsScience, '', '')}
				</td>
				<td>
					${frontUser.grade}
				</td>
				<td>
					${frontUser.account}
				</td>
				<td>
					${frontUser.graduateYear}
				</td>
				<td>
					${fns:getDictLabel(frontUser.loginFlag, 'yes_no', '')}
				</td>
				<td>
					${fns:getDictLabel(frontUser.vipFlag, 'yes_no', '')}
				</td>
				<td>
					${frontUser.loginIp}
				</td>
				<td>
					<fmt:formatDate value="${frontUser.loginDate}" type="both" dateStyle="full"/>
				</td>
				<shiro:hasPermission name="front:frontUser:edit"><td>
    				<a href="${ctx}/front/frontUser/form?id=${frontUser.id}">修改</a>
					<a href="${ctx}/front/frontUser/delete?id=${frontUser.id}" onclick="return confirmx('确认要删除该用户吗？', this.href)">删除</a>
				</td></shiro:hasPermission>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>